﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch01
{
    public partial class Form_Login : Form
    {
        public Form_Login()
        {
            InitializeComponent();
        }
        //文本框失去焦点事件
        private void txt_name_Leave(object sender, EventArgs e)
        {
            //验证文本框是否为空
            if(txt_name.Text=="")
            {
                MessageBox.Show("账号不能为空！");
                //让账号文本框获得焦点
                txt_name.Focus();
            }
        }

        private void txt_name_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form_Login_Load(object sender, EventArgs e)
        {

        }

        private void txt_pwd_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
